package com.k.kppcloud.consumer.feign;

import com.k.kppcloud.consumer.feign.fallback.HelloFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;
// 也可以使用绝对地址访问
//@FeignClient(name = "gateway", url = "${mcc.smp.login-invalid-url}", path = "/auth/", fallbackFactory = LoginRemoteServiceFallBackFactory.class)
@FeignClient(name = "service-inner-provider",fallback = HelloFallback.class)
public interface HelloService {
    @RequestMapping(value = "/api/sayHelloParams", method = RequestMethod.POST)
    String sayHelloParams(@RequestBody List<String> userNameList);

    /**
     * 会负载调用,轮询方式每个一次。
     * @return Result
     */
    @RequestMapping(value = "/api/sayHello", method = RequestMethod.GET)
    String sayHello();
}
